 //增加一个默认的title
 import { ref ,watch } from "vue";

 export default function (title = "默认的title"){
    const titleRef = ref(title);

    //watch是惰性的，所以用immediate来立即执行一次
    watch(titleRef,(newValue) => {
        document.title = newValue;
    },{
        immediate:true
    })
     return titleRef;
 }